package com.cwj.user.fieter;

import lombok.Setter;

import javax.servlet.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * 解决跨域请求
 */
@Setter
public class cross_domain_filter implements Filter {
    private String Url;
    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        HttpServletResponse response=(HttpServletResponse) servletResponse;

        response.addHeader( "Access-Control-Allow-Origin", "*" );
        filterChain.doFilter(servletRequest,response);
    }
}
